﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Experimentor
{
    public enum PAFieldtype
    {
        Textfield,
        Radiobuttons,
        Selector
    };
    
    public class PersonAttribute : IComparable
    {
        private int _attOrder;
        private string _attVarname;
        private string _attText;
        private bool _attMandatory;
        private PAFieldtype _attFieldtype;
        private string _attValues;
        private string _attStyle;

        public PersonAttribute()
        {
            this._attOrder = 0;
            this._attVarname = "<enter SPSS variable name>";
            this._attFieldtype = PAFieldtype.Textfield;
        }

        public int Order
        {
            get { return this._attOrder; }
            set { this._attOrder = value; }
        }

        public string Varname
        {
            get { return this._attVarname; }
            set { this._attVarname = value; }
        }

        public string Text
        {
            get { return this._attText; }
            set { this._attText = value; }
        }

        public bool Mandatory
        {
            get { return this._attMandatory; }
            set { this._attMandatory = value; }
        }

        public PAFieldtype Fieldtype
        {
            get { return this._attFieldtype; }
            set { this._attFieldtype = value; }
        }

        public string Values
        {
            get { return this._attValues; }
            set { this._attValues = value; }
        }

        public string Style
        {
            get { return this._attStyle; }
            set { this._attStyle = value; }
        }

        int IComparable.CompareTo(object obj)
        {
            if (obj.GetType().Equals(this.GetType()))
            {
                return this.Order - (obj as PersonAttribute).Order;
            }
            else return 0;
        }
    }
}
